john's calculator is a simple, powerful, and fast keyboard-based calculator. Expressions are entered as by hand, using either the keyboard or calculator buttons. Standard editing commands like cut, copy, and paste are fully supported. Variables can be used to simplify expressions.
This is a beta version of john's calculator. If you find bugs or have suggestions please contact me at one of the addresses given above.
Installation:
Copy the file "john's calculator" to where you want it. That's it.
How to use john's calculator:
Enter an expression on a line by itself. Then press the ENTER key to evaluate the line, regardless of where the cursor is in the line.
Note that you must press the ENTER key to evaluate an expression - the RETURN key inserts a carriage return but does not evaluate.
You can return to a previous line, edited it, press the ENTER key and the changed line will be evaluated.
Some examples:
2(2+3) enter 2(2+3) then press the ENTER key
10 the line is evaluated and the value returned on the next line
2e2^2 this is the same as 200^2 (2e2 is 2x10^2)
40000
5log(2^5) this is the same as 5(log(2^5))
7.52575
5log2^5 this is the same as 2((log2)^5)
0.01236
10->x store 10 in the variable named x
10
20->y store 20 in the variable named y
20
2x+3y this is the same as 2(10)+3(20)
80
-1-9->x now store -1-9 in x
-10
2x+3y now this is the same as 2(-10)+3(20)
40
:5->x store 5 in x, ":" stops the value from being returned
:2->y store 2 in y
x^2+y^2 this is the same as 5^2+2^2
29
Now we could return to the line ":5->x", change the 5 to a 0 and press the ENTER key. This would change the value of x to 0.
If we then return to the line "x^2+y^2" and press the ENTER key, 4 is returned (0^2+2^2).
1+2
3
ans enter ans then press the ENTER key
3 the last answer, 3, is returned
1+ans this is the same as 1+3 since 3 was the last answer
4
5-2
3
+2 this is the same as 3+2 since the previous answer is used when not
5 enough arguments are given on a line
^3 this is the same as 5^3
125
60!
? 60! is too big to display in decimal mode
60! use radio button to change display mode to scientific display
8.32099e+81 no problem (though precision is lost)
Most operations which take two arguments can be enter as opn(arg1,arg2) or arg1opnarg2. Usually one of the two forms is much clearer.
examples:
gcd(10,2) and 10gcd2 both return 2 (the greatest common divisor)
10^2 and ^(10,2) both return 100
There is a complete list of operations below.
Buttons:
Input buttons:
All operations are available on calculator input buttons.
Radio buttons:
(1) Mode group - sets mode to radians or degrees
(2) Display group - sets calculator to display answer in decimal or scientific notation form
(3) Level group - sets which level of input buttons is shown
Enter button:
Same as pressing the ENTER key.
Menus:
The "File" and "Edit" menus work in the usual fashion.
Variables menu:
Show - shows all variables and values
Clear All - clears all variables (so no variables are stored)
The variable menu is not available unless a variable is defined.
Evaluation Errors:
If john's calculator can't understand an operation it will highlight the first thing it doesn't understand (and beep at you).
If there are not enough arguments for the operations in an expression an alert box will pop
up and say so.
Gotchas:
(1) You must use the ENTER key, not the RETURN key, to evaluate a line.
(2) Rules about variable names.
(a) Variable names are not case sensitive. So "x" and "X" are the same variable names.
(b) Variable names can contain spaces except at the beginning. So "x1" and "x1 " are
different variables. But "2-> x" would store 2 in the variable named "x".
(c) Variable names can be any length. So "my variable" is a valid variable name.
(d) Just about any character is valid in variable name. So "#$-" is ok.
(3) When evaluating a line john's calculator checks for variable names before anything else.
You can use a variable named "log" if you want but this carries obvious risks.
(4) Up to 100 variables can be stored. You can clear all variables using the "Clear All"
command of the "Variables" menu or clear individual variables using the "<-" operator.
(5) The calculator only ask if you want to save changes if you are working with a named
file.
(6) ":" must be the first non-blank character on a line.
(7) In decimal display mode answers are rounded after 19 digits.
Operations:
Here is a listing of the operations john's calculator understands.
+ addition
- subtraction
* multiplication
/ division
^ exponentiation
ln natural logarithm
log logarithm base 10
lognx logarithm base n of x
lognx(2,16) returns 4
() parentheses
, separates arguments
sin sine
cos cosine
tan tangent
cot cotangent
ans last answer returned
sqrt square root
% percent
5%20 returns 25 (since 5 is 25% of 20)
1/x reciprocal
// modulus (remainder)
16//7 returns 2 (since the remainder for 16/7 is 2)
^(1/) arbitrary root
16^(1/4) returns 2 (since the principle 4th root of 16 is 2)
e^ natural base e raised to an exponent
: don't return value (must be at start of line)
-> store value in variable
<- clear variable name
<-x returns value in x and clears x from storage
r2d change radians to degrees
arcSin arcSine
arcCos arcCosine
arcTan arcTangent
arcCot arcCotangent
d2r change degrees to radians
mPn permutations of n things taken from m things
mPn(10,2) or 10mPn2 returns 90
mCn combinations of n things taken from m things
mCn(10,2) or 10mCn2 returns 45
! factorial
gcd greatest common divisor
gcd(200,60) returns 20
lcm least common multiple
pi π
e the natural base e
round round to integer
round(2.514) returns 3
trunc truncates to integer
trunc(2.514) returns 2
abs absolute value
csc coSecant
sec secant
sinh hyperbolic sine
cosh hyperbolic cosine
tanh hyperbolic tangent
Known bugs:
None (oh boy).
Version History:
0.0b - first beta release (22 Jan 1996)
0.1b - 2nd beta release (24 Feb 1996)
fixed some problems with file handling
cleaned-up resizing
cleaned/fixed some internals
Standard Stuff:
Although copyrighted, john's calculator is freeware and may be distributed freely as long as this file is included. However, ownership of and interest in this software shall remain with John Wilhelm.
This software is provided “as is” without warranty of any kind. The entire risk as to the results of using this software lies entirely with the user.
In no event shall the author be liable for any damages arising out of the use or inability to use this software.